

package com.soso.base.google.mq;

import com.caucho.hessian.callback.HessianCallback;


/**
 * 
 * @author speed
 *
 */
@SuppressWarnings("serial")
public class CallbackMessage extends AbstractMessage {

	private HessianCallback hessianCallback;
	
	public CallbackMessage(String topic, HessianCallback hessianCallback) {
		super();
		setTopic(topic);
		this.hessianCallback=hessianCallback;
	}

	public CallbackMessage(Enum<?> topic, HessianCallback hessianCallback) {
		this(topic.name(), hessianCallback);
	}

	public CallbackMessage(Class<?> clazz) {
		this("simple.command", null);
		setCommandClassName(clazz.getName());
	}

	public CallbackMessage(Enum<?> topic, QueueName queueName, HessianCallback hessianCallback) {
		this(topic.name(), hessianCallback);
		setQueueName(queueName);
	}

	public CallbackMessage(Enum<?> topic) {
		this(topic.name(), null);
	}

	@Override
	public HessianCallback getMessage() {
		return hessianCallback;
	}

}
